package com.zxq.exchange.enums;

public enum ETcpFrame {

    /**
     * modbus
     */
    modbus(1),
    /**
     * 电表
     */
    dlt645(2),
    /**
     * jt808
     */
    jt808(3),
    /**
     * 未知
     */
    unknow(-1)
    ;

    Integer value;
    ETcpFrame(Integer i) {
        this.value = i;
    }

    public Integer getValue() {
        return value;
    }

    public static ETcpFrame getType(Integer value){
        ETcpFrame eTcpFrame = ETcpFrame.unknow;
        switch (value) {
            case 1:
                eTcpFrame = ETcpFrame.modbus;
                break;
            case 2:
                eTcpFrame = ETcpFrame.dlt645;
                break;
            case 3:
                eTcpFrame = ETcpFrame.jt808;
                break;
        }
        return eTcpFrame;
    }






}
